package the_Crash;

import repast.simphony.random.RandomHelper;
import repast.simphony.space.continuous.ContinuousSpace;
import repast.simphony.space.continuous.NdPoint;
import repast.simphony.space.grid.Grid;
import repast.simphony.space.grid.GridPoint;

//class which aids in the display of the signals
public class Light extends BaseSimEntity {

	private double redColor=10;
	private double greenColor=0;
	private double blueColor=0;
	private double xOffset=0;
	private double yOffset=0;
	
	public Light(double xOffset, double yOffset, GridPoint location, Grid<Object> grid, ContinuousSpace<Object> space) {
		super(location,grid,space);
		
		this.xOffset=xOffset;
		this.yOffset=yOffset;
	}
	
	public void initialize()
	{
		this.moveToLocation();
		space.moveTo(this, location.getX()+xOffset, location.getY()+yOffset);
	}
	
	public void turnGreen()
	{
		redColor=0;
		blueColor=0;
		greenColor=10;
	}	
	public void turnRed()
	{
		redColor=10;
		blueColor=0;
		greenColor=0;
	}
	
	public double getRed()
	{
		return redColor;
	}
	public double getBlue()
	{
		return blueColor;
	}
	public double getGreen()
	{
		return greenColor;
	}

}
